<template>
	<view>
		
		<image style="width: 100%;" :src="url" />
		<text>{{address}}</text>
		<button type="primary" @click = "toMain">点击进入</button>
	</view>
</template>

<script>
	
	export default {
		data() {
			return {
				// 为什么通过getters获取不到image
				// url : this.$store.getters.image
			}
		},
		computed:{
			url(){
				return this.$store.state.image
			} ,
			address(){
				return this.$store.state.address
			}
		},
		
		onLoad() {
			// this.$store.dispatch('setImage');
			this.$store.dispatch('getCitys');
		},
		onReady() {
			// this.$store.dispatch('getCitys');
		},
		
		methods: {
			toMain(){
				uni.navigateTo({
					url:"../main/main"
				})
			}
		}
	}
</script>

<style lang="scss">
	page{
		height: 100%;
	}
	view{
	position: relative;
	height: 100%;
	button{
		text-align: center;
		position: absolute;
		bottom: 10px;
	}
}
</style>
